<!DOCTYPE html><html lang="zh-CN" data-theme="dark"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>J.のblog</title><meta name="author" content="J."><meta name="copyright" content="J."><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#0d0d0d"><meta property="og:type" content="website">
<meta property="og:title" content="J.のblog">
<meta property="og:url" content="http://dycloudnavite.love/page/5/index.html">
<meta property="og:site_name" content="J.のblog">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://dycloudnavite.love/img/touxiang.png">
<meta property="article:author" content="J.">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://dycloudnavite.love/img/touxiang.png"><link rel="shortcut icon" href="/dujie5416/img/touxiang.png"><link rel="canonical" href="http://dycloudnavite.love/page/5/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/dujie5416/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/dujie5416/',
  algolia: {"appId":"9GWB2VV7GN","apiKey":"dac56ec5b0b1f45281251ee59db4d637","indexName":"blog","hits":{"per_page":6},"languages":{"input_placeholder":"搜索文章","hits_empty":"找不到您查询的内容：${query}","hits_stats":"找到 ${hits} 条结果，用时 ${time} 毫秒"}},
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'J.のblog',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2024-01-30 11:12:40'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/xxx.css"><link rel="stylesheet" href="/css/universe.css"><link rel="stylesheet" href="/css/custom.css"><style type="text/css">#toggle-sidebar {bottom: 80px}</style><link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/tzy13755126023/BLOG_SOURCE/css/function.min.css"><link rel="stylesheet" href="/css/rightMenu.css"><style type="text/css">#toggle-sidebar {left:100px}</style><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/clock.min.css" /><!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/dujie5416/atom.xml" title="J.のblog" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/dujie5416/img/touxiang.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/dujie5416/archives/"><div class="headline">文章</div><div class="length-num">73</div></a><a href="/dujie5416/tags/"><div class="headline">标签</div><div class="length-num">17</div></a><a href="/dujie5416/categories/"><div class="headline">分类</div><div class="length-num">11</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/dujie5416/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/dujie5416/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/dujie5416/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/dujie5416/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('/dujie5416/img/longzhu.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/dujie5416/">J.のblog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/dujie5416/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/dujie5416/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/dujie5416/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/dujie5416/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">J.のblog</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/dujie5416/2022/07/05/kubernetes%20HPA%E4%BD%BF%E7%94%A8%E5%8F%8A%E6%B5%8B%E8%AF%95/" title="kubernetesHPA使用及测试"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetesHPA使用及测试"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/05/kubernetes%20HPA%E4%BD%BF%E7%94%A8%E5%8F%8A%E6%B5%8B%E8%AF%95/" title="kubernetesHPA使用及测试">kubernetesHPA使用及测试</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-05T06:32:00.000Z" title="发表于 2022-07-05 14:32:00">2022-07-05</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">一、安装metrics serverMetrics Server是Kubernetes内置的容器资源指标来源。Metrics Server从node节点上的Kubelet收集资源指标,并通过Metrics API在 Kubernetes apiserver中公开指标数据,以供Horizontal Pod Autoscaler和Vertical Pod Autoscaler使用,也可以通过访问kubectl top node&#x2F;pod查看指标数据。使用Metrics-Server监控node和pod计算资源使用情况，并提供给第三方使用下载地址：gituhub地址修改资源定义文件
root@master:~&#x2F;.kube# vim components.yaml
修改镜像位置:
image: k8s.gcr.io&#x2F;metrics-server&#x2F;metrics-server:v0.6.1
修改为：
registry.cn-hangzhou.aliyuncs.com&#x2F;liangxiaohui&#x2F;metrics-server:0.6.1
部署 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dujie5416/2022/07/04/k8s-job%20cronjob/" title="kubernetes常用资源——job/cronjob"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——job/cronjob"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/04/k8s-job%20cronjob/" title="kubernetes常用资源——job/cronjob">kubernetes常用资源——job/cronjob</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-04T04:32:00.000Z" title="发表于 2022-07-04 12:32:00">2022-07-04</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">k8s-job&#x2F;cronjob1、job(初始化数据库等操作，只执行一次)
[root@haproxy1 case2-job]# cat 1.job.yaml 
apiVersion: batch/v1
kind: Job
metadata:
  name: job-mysql-init
  namespace: test
spec:
  template:
    spec:
      containers:
      - name: job-mysql-init-container
        image: centos:7.9.2009
        command: ["/bin/sh"]
        args: ["-c", "echo data init job at `date +%Y-%m-%d_%H-%M-%S` >> /cache/data.log"]
        volumeMounts:
        - mountPath: /cache
          name: cache-volume
      volumes:
   ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dujie5416/2022/07/03/Volume%E5%AD%98%E5%82%A8%E5%8D%B7/" title="kubernetes常用资源——Volume存储卷"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——Volume存储卷"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/03/Volume%E5%AD%98%E5%82%A8%E5%8D%B7/" title="kubernetes常用资源——Volume存储卷">kubernetes常用资源——Volume存储卷</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-03T10:32:00.000Z" title="发表于 2022-07-03 18:32:00">2022-07-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">Volume存储卷

Volume将容器中的指定数据和容器解耦，并将数据存储到指定的位置，不同的存储卷功能不一致，如果是基于网络存储的存储卷可以实现容器间的数据共享和持久化。
静态存储卷需要在使用前手动创建pv和pvc，然后绑定至pod使用
常用的几种卷：
emptyDir：本地临时卷
hostPath：本地存储卷
configmap：配置文件
Secret：是一种包含少量敏感信息例如密码、令牌或密钥的对象
nfs等网络存储卷



https://kubernetes.io/zh/docs/concepts/storage/volumes/
一、emptyDiremptyDir：本地临时卷，pod删除卷也跟着删除，通常用于两个pod之间日志共享

当pod被分配给节点时，首先创建emptydir卷，并且只要该Pod在该节点上运行，该卷就会存在，正如卷的名字所述，它最初是空的，Pod中的容器可以读取和写入emptyDir卷中的相同文件，尽管该卷可以挂载到每个容器中的相同或不同路径上，当出于任何原因从节点中删除pod时，emptyDir中的数据将被永久删除。
&#x2F;var&#x2F ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dujie5416/2022/07/03/secret/" title="kubernetes常用资源——secret"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——secret"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/03/secret/" title="kubernetes常用资源——secret">kubernetes常用资源——secret</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-03T08:32:00.000Z" title="发表于 2022-07-03 16:32:00">2022-07-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">secretSecret 的功能类似于configmap给pod提供额外的配置信息，但是secret是一种包含少量敏感信息例如密码，令牌或秘钥的对象
Secret的名称必须是合法的DNS子域名
每个Secret的大小最多为1Mib，主要是为了避免用户创建非常大的Secret进而导致API服务器和kubelet内存耗尽，不过创建很多小的Secret也可能耗尽内存，可以使用资源配额来约束每个名字空间中的Secret个数
在通过yaml文件创建secret时，可以设置data或stringData字段，data和stringData字段都是可选的，data字段中所有的键值都必须是base64编码的字符串，如果不希望执行这种base64字符串的转换操作，也可以选择设置stringData字段，其中可以使用任何非加密的字符串作为其值。
Pod可以用三种方式的任意一种来使用Secret

作为挂载到一个或多个容器上的卷中的文件（crt文件，key文件）
作为容器的环境变量
由kubelet在为pod拉取镜像时使用（与镜像仓库的认证）

一、Secret类型：kubernetes默认支持多种不同类型 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dujie5416/2022/07/03/Service%E6%8E%A7%E5%88%B6%E5%99%A8/" title="kubernetes常用资源——Service"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——Service"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/03/Service%E6%8E%A7%E5%88%B6%E5%99%A8/" title="kubernetes常用资源——Service">kubernetes常用资源——Service</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-03T03:32:00.000Z" title="发表于 2022-07-03 11:32:00">2022-07-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">Service控制器由于Pod重建之后ip就变了，因此pod之间使用的IP直接访问会出现无法访问的问题，而service则解耦了服务和应用，service的实现方式就是通过label标签动态匹配后端endpoint。
kube-proxy 监听着k8s-apiserver，一旦service资源发生变化（调k8s-api修改service信息），kube-proxy 就会生成对应得负载调度得调整，这样就保证了service得最新状态

service类型：

ClusterIP：用于内部服务基于service name的访问
NodePort：用于K8s集群以外的服务主动访问运行在kubernetes集群内部的服务
LoadBalancer：用于公有云环境的服务暴露
ExternalName：用于将k8s集群外部的服务映射至K8s集群内部访问，从而让集群内部的pod能够通过固定的service name访问集群外部的服务，有时候也用于将不同namespace 之间的pod通过ExternalName 进行访问

clusterIP:
[root@haproxy1 case4-servi ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dujie5416/2022/07/02/Configmap/" title="kubernetes常用资源——configMap"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——configMap"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/02/Configmap/" title="kubernetes常用资源——configMap">kubernetes常用资源——configMap</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-02T08:42:00.000Z" title="发表于 2022-07-02 16:42:00">2022-07-02</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">Configmapconfigmap配置信息和镜像解耦，实现方式为将配置信息放到configmap对象中，然后在pod中作为volume挂载到pod中，从而实现导入配置的目的。
使用场景：

通过configmap给pod定义全局环境变量
通过configmap给pod传递命令行参数，如mysql -u -p 中的账户名密码可以通过configmap传递
通过configmap给pod中的容器服务提供配置文件，配置文件以挂载到容器的形式使用

注意：configmap需要在pod使用它之前创建。

pod只能使用位于同一个namespace的configmap，即configmap不能跨namespace使用
通常用语非安全加密的配置场景
configmap通常是小于1MB的配置

示例1：
[root@haproxy1 case10-configmap]# cat 1-deploy_configmap.yml 
#定义configmap资源
apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-config
  namespac ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dujie5416/2022/07/02/PV%20PVC/" title="kubernetes常用资源——PV/PVC"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——PV/PVC"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/02/PV%20PVC/" title="kubernetes常用资源——PV/PVC">kubernetes常用资源——PV/PVC</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-02T03:32:00.000Z" title="发表于 2022-07-02 11:32:00">2022-07-02</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">PV&#x2F;PVC
PV：persistentVolume （与硬件（nfs、ceph等）对接）

是集群中已经由kubernetes 管理员配置的一个网络存储，集群中的存储资源一个集群资源，即不隶属于任何namespace，PV的数据最终存储在硬件存储，pod不能字节挂载pv，pv需要绑定给pvc并最终由pod挂载pvc使用，PV支持NFS、Ceph，商业存储或云提供商的听特定的存储等，可以自定义PV的类型是块还是文件存储，存储空间大小，访问模式等，PV的生命周期独立于Pod，即当使用PV的Pod被删除时可以对PV的数据没有影响

PVC：persistentVolumeClaim（与pod关联，与pv绑定）

PVC是对存储的请求，pod挂载PVC并将数据存储在PVC，而PVC需要绑定到PV才能使用，另外PVC在创建的时候要知道namespace，即Pod要和PVC在同一个namespace下，可以对pvc设置特定的空间大小和访问模式，使用PVC的pod在删除时也可以对PVC中的数据没有影响

用于实现pod和storage的解耦，这样我们修改storage的时候不需要修改po ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dujie5416/2022/07/01/Deployment%E5%89%AF%E6%9C%AC%E6%8E%A7%E5%88%B6%E5%99%A8/" title="kubernetes常用资源——deployment"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——deployment"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/01/Deployment%E5%89%AF%E6%9C%AC%E6%8E%A7%E5%88%B6%E5%99%A8/" title="kubernetes常用资源——deployment">kubernetes常用资源——deployment</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-01T04:34:00.000Z" title="发表于 2022-07-01 12:34:00">2022-07-01</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">Deployment副本控制器Deployment：比rs更高级的控制器，除了有rs的功能之外，还有很多高级的功能，比如最重要的滚动升级、回滚等
[root@haproxy1 case3-controller]# cat deployment.yml 
#apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    #app: ng-deploy-80 #rc
    matchLabels: #rs or deployment
      app: ng-deploy-80
    
    #matchExpressions:
    #  - &#123;key: app, operator: In, values: [ng-deploy-80,ng-rs-81]&#125;
  template:
    metadata:
      labels:
       ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/dujie5416/2022/07/01/RC%20RS%E5%89%AF%E6%9C%AC%E6%8E%A7%E5%88%B6%E5%99%A8/" title="kubernetes常用资源——RC/RS"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubernetes常用资源——RC/RS"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/07/01/RC%20RS%E5%89%AF%E6%9C%AC%E6%8E%A7%E5%88%B6%E5%99%A8/" title="kubernetes常用资源——RC/RS">kubernetes常用资源——RC/RS</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-01T04:32:00.000Z" title="发表于 2022-07-01 12:32:00">2022-07-01</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">RC&#x2F;RS副本控制器Replication Controller:副本控制器（selector &#x3D;  !&#x3D;）#第一代pod副本控制器
[root@haproxy1 case3-controller]# cat rc.yml 
apiVersion: v1  
kind: ReplicationController  
metadata:  
  name: ng-rc
spec:  
  replicas: 2
  selector:  
    app: ng-rc-80 
    #app1: ng-rc-81
  template:   
    metadata:  
      labels:  
        app: ng-rc-80
        #app1: ng-rc-81
    spec:  
      containers:  
      - name: ng-rc-80 
        image: nginx  
        ports:  
        - containerPort: 80 


Repl ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/dujie5416/2022/06/24/kubeasz%20-etcd%20v3%20API%E7%89%88%E6%9C%AC%E6%95%B0%E6%8D%AE%E5%A4%87%E4%BB%BD%E4%B8%8E%E6%81%A2%E5%A4%8D/" title="kubeasz -etcd v3 API版本数据备份与恢复"><img class="post_bg" src="/dujie5416/img/kubernetes.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="kubeasz -etcd v3 API版本数据备份与恢复"></a></div><div class="recent-post-info"><a class="article-title" href="/dujie5416/2022/06/24/kubeasz%20-etcd%20v3%20API%E7%89%88%E6%9C%AC%E6%95%B0%E6%8D%AE%E5%A4%87%E4%BB%BD%E4%B8%8E%E6%81%A2%E5%A4%8D/" title="kubeasz -etcd v3 API版本数据备份与恢复">kubeasz -etcd v3 API版本数据备份与恢复</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-06-24T06:32:00.000Z" title="发表于 2022-06-24 14:32:00">2022-06-24</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/dujie5416/categories/kubernetes/">kubernetes</a></span></div><div class="content">WAL是warite ahead log(预写式日志)得缩写，顾名思义，也就是在执行真正得写操作之前先写一个日志，预写日志。wal：存放预写式日志，最大得作用是记录了整个数据变化得全部历程，在etcd中，所有数据得修改在提交前，都要先写入到WAL中。
一、单机版etcd恢复数据V3 版本备份数据(单机版)：
#备份
[root@etcd1 ~]# ETCDCTL_API=3 etcdctl snapshot save snapshop.db
#恢复到一个指定目录
[root@etcd1 ~]# ETCDCTL_API=3 etcdctl snapshot restore snapshop.db --data-dir=/opt/etcd-testdir-2
Deprecated: Use `etcdutl snapshot restore` instead.

2022-05-05T20:38:13+08:00       info    snapshot/v3_snapshot.go:251     restoring snapshot      &#123;"path": "snap ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/dujie5416/page/4/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/dujie5416/">1</a><span class="space">&hellip;</span><a class="page-number" href="/dujie5416/page/4/#content-inner">4</a><span class="page-number current">5</span><a class="page-number" href="/dujie5416/page/6/#content-inner">6</a><span class="space">&hellip;</span><a class="page-number" href="/dujie5416/page/8/#content-inner">8</a><a class="extend next" rel="next" href="/dujie5416/page/6/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/dujie5416/img/touxiang.png" onerror="this.onerror=null;this.src='/dujie5416/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">J.</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/dujie5416/archives/"><div class="headline">文章</div><div class="length-num">73</div></a><a href="/dujie5416/tags/"><div class="headline">标签</div><div class="length-num">17</div></a><a href="/dujie5416/categories/"><div class="headline">分类</div><div class="length-num">11</div></a></div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/dujie5416/2023/07/29/%E6%A0%B9%E6%8D%AErouter%E6%98%BE%E7%A4%BA%E5%B7%A6%E4%BE%A7%E8%8F%9C%E5%8D%95%E6%A0%8F%E9%9A%90%E8%97%8F%E6%9F%90%E4%B8%AA%E8%8F%9C%E5%8D%95%E9%80%89%E9%A1%B9/" title="vue3左侧菜单隐藏某选项"><img src="/dujie5416/img/golang.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="vue3左侧菜单隐藏某选项"/></a><div class="content"><a class="title" href="/dujie5416/2023/07/29/%E6%A0%B9%E6%8D%AErouter%E6%98%BE%E7%A4%BA%E5%B7%A6%E4%BE%A7%E8%8F%9C%E5%8D%95%E6%A0%8F%E9%9A%90%E8%97%8F%E6%9F%90%E4%B8%AA%E8%8F%9C%E5%8D%95%E9%80%89%E9%A1%B9/" title="vue3左侧菜单隐藏某选项">vue3左侧菜单隐藏某选项</a><time datetime="2023-07-29T06:32:00.000Z" title="发表于 2023-07-29 14:32:00">2023-07-29</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dujie5416/2023/07/13/Vue%E7%8A%B6%E6%80%81%E7%AE%A1%E7%90%86/" title="Vue状态管理"><img src="/dujie5416/img/golang.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="Vue状态管理"/></a><div class="content"><a class="title" href="/dujie5416/2023/07/13/Vue%E7%8A%B6%E6%80%81%E7%AE%A1%E7%90%86/" title="Vue状态管理">Vue状态管理</a><time datetime="2023-07-13T09:29:00.000Z" title="发表于 2023-07-13 17:29:00">2023-07-13</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dujie5416/2023/06/27/%E5%9F%BA%E4%BA%8EIOC%E8%A7%A3%E5%86%B3%E5%AF%B9%E8%B1%A1%E4%BE%9D%E8%B5%96%E9%97%AE%E9%A2%98/" title="基于IOC解决对象依赖问题"><img src="/dujie5416/img/golang.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="基于IOC解决对象依赖问题"/></a><div class="content"><a class="title" href="/dujie5416/2023/06/27/%E5%9F%BA%E4%BA%8EIOC%E8%A7%A3%E5%86%B3%E5%AF%B9%E8%B1%A1%E4%BE%9D%E8%B5%96%E9%97%AE%E9%A2%98/" title="基于IOC解决对象依赖问题">基于IOC解决对象依赖问题</a><time datetime="2023-06-27T03:32:00.000Z" title="发表于 2023-06-27 11:32:00">2023-06-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dujie5416/2023/06/23/Gin%E6%A1%86%E6%9E%B6/" title="Gin框架"><img src="/dujie5416/img/golang.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="Gin框架"/></a><div class="content"><a class="title" href="/dujie5416/2023/06/23/Gin%E6%A1%86%E6%9E%B6/" title="Gin框架">Gin框架</a><time datetime="2023-06-23T06:32:00.000Z" title="发表于 2023-06-23 14:32:00">2023-06-23</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/dujie5416/2023/06/04/ServeMux%E3%80%81httprouter/" title="ServeMux、httprouter"><img src="/dujie5416/img/golang.png" onerror="this.onerror=null;this.src='/dujie5416/img/404.jpg'" alt="ServeMux、httprouter"/></a><div class="content"><a class="title" href="/dujie5416/2023/06/04/ServeMux%E3%80%81httprouter/" title="ServeMux、httprouter">ServeMux、httprouter</a><time datetime="2023-06-04T03:32:00.000Z" title="发表于 2023-06-04 11:32:00">2023-06-04</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            <a class="card-more-btn" href="/dujie5416/categories/" title="查看更多">
    <i class="fas fa-angle-right"></i></a>
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/Django/"><span class="card-category-list-name">Django</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/Docker/"><span class="card-category-list-name">Docker</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/SonarQube/"><span class="card-category-list-name">SonarQube</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/golang/"><span class="card-category-list-name">golang</span><span class="card-category-list-count">30</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/iptables/"><span class="card-category-list-name">iptables</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/jenkins/"><span class="card-category-list-name">jenkins</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/kubernetes/"><span class="card-category-list-name">kubernetes</span><span class="card-category-list-count">18</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/dujie5416/categories/linux/"><span class="card-category-list-name">linux</span><span class="card-category-list-count">7</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/dujie5416/tags/Django/" style="font-size: 1.1em; color: #999">Django</a> <a href="/dujie5416/tags/Python/" style="font-size: 1.1em; color: #999">Python</a> <a href="/dujie5416/tags/SonarQube/" style="font-size: 1.1em; color: #999">SonarQube</a> <a href="/dujie5416/tags/centos/" style="font-size: 1.23em; color: #999ea6">centos</a> <a href="/dujie5416/tags/docker/" style="font-size: 1.1em; color: #999">docker</a> <a href="/dujie5416/tags/golang/" style="font-size: 1.43em; color: #99a6b9">golang</a> <a href="/dujie5416/tags/grafana/" style="font-size: 1.1em; color: #999">grafana</a> <a href="/dujie5416/tags/iptables/" style="font-size: 1.1em; color: #999">iptables</a> <a href="/dujie5416/tags/jenkins/" style="font-size: 1.17em; color: #999c9f">jenkins</a> <a href="/dujie5416/tags/kubernetes/" style="font-size: 1.37em; color: #99a4b2">kubernetes</a> <a href="/dujie5416/tags/linux/" style="font-size: 1.23em; color: #999ea6">linux</a> <a href="/dujie5416/tags/mysql/" style="font-size: 1.3em; color: #99a1ac">mysql</a> <a href="/dujie5416/tags/prometheus/" style="font-size: 1.1em; color: #999">prometheus</a> <a href="/dujie5416/tags/python/" style="font-size: 1.1em; color: #999">python</a> <a href="/dujie5416/tags/svn/" style="font-size: 1.1em; color: #999">svn</a> <a href="/dujie5416/tags/%E4%BA%91%E5%8E%9F%E7%94%9F/" style="font-size: 1.5em; color: #99a9bf">云原生</a> <a href="/dujie5416/tags/%E9%98%BF%E9%87%8C%E4%BA%91/" style="font-size: 1.1em; color: #999">阿里云</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/dujie5416/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2023/07/"><span class="card-archive-list-date">七月 2023</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2023/06/"><span class="card-archive-list-date">六月 2023</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2023/05/"><span class="card-archive-list-date">五月 2023</span><span class="card-archive-list-count">9</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2023/04/"><span class="card-archive-list-date">四月 2023</span><span class="card-archive-list-count">12</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2023/02/"><span class="card-archive-list-date">二月 2023</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2023/01/"><span class="card-archive-list-date">一月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2022/08/"><span class="card-archive-list-date">八月 2022</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/dujie5416/archives/2022/07/"><span class="card-archive-list-date">七月 2022</span><span class="card-archive-list-count">9</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">73</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2019-09-04T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-01-30T03:12:39.963Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('/dujie5416/img/longzhu.png')"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2024  <i id="heartbeat" class="fa fas fa-heartbeat"></i> J.</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a><a href="http://beian.miit.gov.cn/"  style="color:#f72b07" target="_blank">京ICP备2022023567号</a></div></div><link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/HCLonely/images@master/others/heartbeat.min.css"></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr/><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div></div><div id="rightMenu"><div class="rightMenu-group rightMenu-small"><div class="rightMenu-item" id="menu-backward"><i class="fa-solid fa-arrow-left"></i></div><div class="rightMenu-item" id="menu-forward"><i class="fa-solid fa-arrow-right"></i></div><div class="rightMenu-item" id="menu-refresh"><i class="fa-solid fa-arrow-rotate-right"></i></div><div class="rightMenu-item" id="menu-home"><i class="fa-solid fa-house"></i></div></div><div class="rightMenu-group rightMenu-line rightMenuOther"><a class="rightMenu-item menu-link" href="/archives/"><i class="fa-solid fa-archive"></i><span>文章归档</span></a><a class="rightMenu-item menu-link" href="/categories/"><i class="fa-solid fa-folder-open"></i><span>文章分类</span></a><a class="rightMenu-item menu-link" href="/tags/"><i class="fa-solid fa-tags"></i><span>文章标签</span></a></div><div class="rightMenu-group rightMenu-line rightMenuNormal"><a class="rightMenu-item menu-link" id="menu-radompage" href="/random/index.html"><i class="fa-solid fa-shoe-prints"></i><span>随便逛逛</span></a><div class="rightMenu-item" id="menu-translate"><i class="fa-solid fa-earth-asia"></i><span>繁简切换</span></div><div class="rightMenu-item" id="menu-darkmode"><i class="fa-solid fa-moon"></i><span>切换模式</span></div></div></div><div id="rightmenu-mask"></div><div><script src="/dujie5416/js/utils.js"></script><script src="/dujie5416/js/main.js"></script><script src="/dujie5416/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/algoliasearch/dist/algoliasearch-lite.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instantsearch.js/dist/instantsearch.production.min.js"></script><script src="/dujie5416/js/search/algolia.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function subtitleType () {
  getScript('https://yijuzhan.com/api/word.php?m=js').then(() => {
    const con = str[0]
    if (true) {
      const from = '出自 ' + str[1]
      const sub = []
      sub.unshift(con, from)
      window.typed = new Typed('#subtitle', {
        strings: sub,
        startDelay: 300,
        typeSpeed: 150,
        loop: true,
        backSpeed: 50,
      })
    } else {
      document.getElementById('subtitle').innerHTML = con
    }
  })
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}
</script></div><script defer src="https://npm.elemecdn.com/jquery@latest/dist/jquery.min.js"></script><script data-pjax defer src="https://npm.elemecdn.com/tzy-blog/lib/js/theme/chocolate.js"></script><canvas id="universe"></canvas><script defer src="/js/universe.js"></script><script defer data-pjax src="/js/rightMenu.js"></script><div class="aplayer no-destroy" data-id="7427714271" data-server="netease" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="false" data-order="random" data-lrctype="1" data-preload="none" data-autoplay="true" muted></div><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-show-text.min.js" data-mobile="false" data-text="I,LOVE,YOU" data-fontsize="15px" data-random="false" async="async"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/metingjs/dist/Meting.min.js"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["meta[property=\"og:image\"]","meta[property=\"og:title\"]","meta[property=\"og:url\"]","head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

  typeof disqusjs === 'object' && disqusjs.destroy()
})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
  function butterfly_clock_anzhiyu_injector_config(){
    var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
    var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img class="entered loading" id="card-clock-loading" src="https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading"/></div></div></div></div></div>';
    console.log('已挂载butterfly_clock_anzhiyu')
    if(parent_div_git) {
      parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  }
  var elist = 'null'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var qweather_key = '56289903f0d448dfbe8262dba0175f70';
  var gaud_map_key = '01603f2b2d08d0e947bb101e9d9b148b';
  var baidu_ak_key = 'undefined';
  var flag = 0;
  var clock_rectangle = '112.982279,28.19409';
  var clock_default_rectangle_enable = 'false';

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_clock_anzhiyu_injector_config();
  }
  else if (epage === cpage){
    butterfly_clock_anzhiyu_injector_config();
  }
  </script><script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script><script data-pjax src="https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/clock.min.js"></script><!-- hexo injector body_end end --><script src="/dujie5416/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"tagMode":false,"debug":false,"model":{"jsonPath":"/dujie5416/live2dw/assets/tororo.model.json"},"display":{"position":"right","width":150,"height":350,"hOffset":20,"vOffset":-20},"mobile":{"show":false},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/"});</script><script async>window.onload=function(){var a=document.createElement('script'),b=document.getElementsByTagName('script')[0];a.type='text/javascript',a.async=!0,a.src='/sw-register.js?v='+Date.now(),b.parentNode.insertBefore(a,b)};</script></body></html>